home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
BORL_TIP
/
TI100
/
TI744.ASC
< prev
next >
Wrap
Text File
|
1992-08-12
|
3KB
|
133 lines
PRODUCT : Turbo Pascal NUMBER : 744
VERSION : 1.0
OS : Windows
DATE : August 12, 1992 PAGE : 1/2
TITLE : Creating and Using Fonts in the Resource Workshop
Detailed below is a step by step description of how a Windows
font file (.FON) is created using Borland's Resource Workshop and
Turbo Pascal for Windows.
1. With the Resource Workshop, create a Resource file and save it
to a file in compiled .RES format.. This is best done by creating
a resource script (a file with the extension .RC) and selecting
the .RES option for MultiSave found in the File/Preferences menu.
2. In Turbo Pascal for Windows, create a library similar to the
one described below.
library NewFont;
{$D FONTRES 100,96,96 : NewFont 12 (VGA res)}
{$M 1024, 0}
{$R NewFont}
begin
end.
The font NewFont is used in this example. You may give your
fonts any name desired. Of the compiler directives, the
Description directive gives the resolution of the font and
provides a description of the font. In the example, the values
100, 96, 96 represent the Aspect, LogPixelsX, LogPixelsY for the
device normally used with the font (in this case VGA). Aspect is
calculated from the expression (100*AspectY) div (AspectX). The
values AspectX, AspectY, LogPixelsX, and LogPixelsY are
accessible through the API function GetDeviceCaps.
If you like, you may have more than one set of Aspect, LogPixelX,
and LogPixelY values. For NewFont, this could take the form of
the following. Each set of values is separated by a semi-colon
and space.
{$D FONTRES 100,96,96; 200,96,48; 133,96,72 :
NewFont 12 (VGA res)}
For font files, the description directive must start with the
term FONTRES in order for the font to be recognized as a valid
Windows font file. It is also very important not to separate
values within a set of Aspect, LogPixelX, LogPixelY values with
spaces. Windows may not recognize a file with values so
delimited.
PRODUCT : Turbo Pascal NUMBER : 744
VERSION : 1.0
OS : Windows
DATE : August 12, 1992 PAGE : 2/2
TITLE : Creating and Using Fonts in the Resource Workshop
3. Compile the library just created to a .DLL file.
4. Rename the .DLL file to one with the extension .FON. In the
case of NewFont, NEWFONT.DLL would be renamed to NEWFONT.FON.
5. Often, .FON are copied into the Windows directory
\WINDOWS\SYSTEM and then added using the Control Panel program.
Note, Microsoft's Control Panel program may not function
correctly with fonts that do encompass the entire alphabet.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.